package com.atguigu.qqzone.service.impl;

import com.atguigu.qqzone.dao.TopicDAO;
import com.atguigu.qqzone.pojo.Topic;
import com.atguigu.qqzone.pojo.UserBasic;
import com.atguigu.qqzone.service.TopicService;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: TopicServiceImpl
 * @Description:
 * @Author: wty
 * @Date: 2022/12/9
 */

public class TopicServiceImpl implements TopicService {
    private TopicDAO topicDAO;

    @Override
    public List<Topic> getTopicList(UserBasic userBasic) {
        String sqlStr = "SELECT a.* FROM qqzonedb2.`t_topic` a INNER JOIN qqzonedb2.`t_user_basic` b ON a.`author` = b.`id` AND a.`author` = ?";
        ArrayList<Topic> list = new ArrayList<>();
        return topicDAO.queryMultiListAndMap(sqlStr, list, userBasic.getId());
    }

    @Override
    public void addTopic(Topic topic) {

    }

    @Override
    public void delTopic(Topic topic) {

    }

    @Override
    public Topic getTopic(Integer id) {
        return null;
    }
}
